/*************************************************************************
	> File Name: P1149.cpp
	> Author: yufangze
	> Mail: 2224590123@qq.com
	> Created Time: 2025-02-10 11:05:16
 ************************************************************************/
#include <iostream>
using namespace std;

int map[10] = {
    6, 2, 5, 5, 4, 5, 6, 3, 7, 6
};

int dfs(int num) {
    if (num < 10) return map[num];
    int sum = 0;
    while (num) {
        sum += map[num % 10];
        num /= 10;
    }
    return sum;
}

int main() {
    int n, cnt = 0;
    cin >> n;
    for (int i = 0; i <= 1000; i++) {
        for (int j = 0; j <= 1000; j++) {
            if (dfs(i) + dfs(j) + dfs(i + j) == n - 4) {
                cnt += 1;
            }
        }
    }
    cout << cnt << endl;
    return 0;
}
